package com.ruoyi.crm.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.crm.domain.CrmOrderRegister;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.CrmOrderRegisterDetailsMapper;
import com.ruoyi.crm.domain.CrmOrderRegisterDetails;
import com.ruoyi.crm.service.ICrmOrderRegisterDetailsService;

/**
 * 项目预算成本费用支出Service业务层处理
 *
 * @author yanwenliang
 * @date 2024-11-09
 */
@Service
public class CrmOrderRegisterDetailsServiceImpl extends ServiceImpl<CrmOrderRegisterDetailsMapper, CrmOrderRegisterDetails> implements ICrmOrderRegisterDetailsService
{
    @Autowired
    private CrmOrderRegisterDetailsMapper crmOrderRegisterDetailsMapper;

    /**
     * 查询项目预算成本费用支出
     *
     * @param detailsId 项目预算成本费用支出主键
     * @return 项目预算成本费用支出
     */
    @Override
    public CrmOrderRegisterDetails selectCrmOrderRegisterDetailsByDetailsId(String detailsId)
    {
        return crmOrderRegisterDetailsMapper.selectCrmOrderRegisterDetailsByDetailsId(detailsId);
    }

    /**
     * 查询项目预算成本费用支出列表
     *
     * @param crmOrderRegisterDetails 项目预算成本费用支出
     * @return 项目预算成本费用支出
     */
    @Override
    public List<CrmOrderRegisterDetails> selectCrmOrderRegisterDetailsList(CrmOrderRegisterDetails crmOrderRegisterDetails)
    {
        return crmOrderRegisterDetailsMapper.selectCrmOrderRegisterDetailsList(crmOrderRegisterDetails);
    }

    /**
     * 新增项目预算成本费用支出
     *
     * @param crmOrderRegisterDetails 项目预算成本费用支出
     * @return 结果
     */
    @Override
    public int insertCrmOrderRegisterDetails(CrmOrderRegisterDetails crmOrderRegisterDetails)
    {
        crmOrderRegisterDetails.setCreateTime(DateUtils.getNowDate());
        return crmOrderRegisterDetailsMapper.insertCrmOrderRegisterDetails(crmOrderRegisterDetails);
    }

    /**
     * 修改项目预算成本费用支出
     *
     * @param crmOrderRegisterDetails 项目预算成本费用支出
     * @return 结果
     */
    @Override
    public int updateCrmOrderRegisterDetails(CrmOrderRegisterDetails crmOrderRegisterDetails)
    {
        return crmOrderRegisterDetailsMapper.updateCrmOrderRegisterDetails(crmOrderRegisterDetails);
    }

    /**
     * 批量删除项目预算成本费用支出
     *
     * @param detailsIds 需要删除的项目预算成本费用支出主键
     * @return 结果
     */
    @Override
    public int deleteCrmOrderRegisterDetailsByDetailsIds(String[] detailsIds)
    {
        return crmOrderRegisterDetailsMapper.deleteCrmOrderRegisterDetailsByDetailsIds(detailsIds);
    }

    /**
     * 删除项目预算成本费用支出信息
     *
     * @param detailsId 项目预算成本费用支出主键
     * @return 结果
     */
    @Override
    public int deleteCrmOrderRegisterDetailsByDetailsId(String detailsId)
    {
        return crmOrderRegisterDetailsMapper.deleteCrmOrderRegisterDetailsByDetailsId(detailsId);
    }
}
